<?php

class Home extends KT_Controllers {

    public function index() {

        /*
          if (!preg_match("/[^A-Za-z 0-9~%.:_\-\/]/", "/asd/mgb/dogs/&*")) {
          echo "A match was found.";
          } else {
          echo "A match was not found.";
          } */
        /*
          $this->view->addData(array('ops' => 'Pesho'));
          $this->view->show(array('let', 'main'), array('var' => 'WIN'));
         */
        /*
          echo '<br>';
          $this->car->drive();
         */
//$asd = $this->view->get(array('let', 'main'), array('var' => 'WIN'));  
//$this->banan->sayBanan();
//$this->car->drive();
//$this->negro->vikai();
        /*
          $this->ceko->leko();
          $this->ceko->leko();
          $this->ceko->leko();
          $this->ceko->leko();
         */
        //echo '<pre>';
        //$this->load->library('db');
//$this->db->where('COUNTRY_NAME', 'argentina');
//$this->db->orWhere('COUNTRY_NAME', 'Switzerland');
        //$this->db->connect();
        //$this->db->setTable('users');
        //$this->db->where('id', 13);
        //echo $this->db->delete('users');
        //var_dump($this->db->getError());
        //$this->db->insert('users', array('username' => 'stamat', 'password' => 'strelko'));
        //$this->db->exec('asd');
        //$win = $this->db->exec("INSERT INTO `test`.`countries` (`COUNTRY_ID` ,`COUNTRY_NAME` ,`REGION_ID`) VALUES ('12', 'CIGANIQ', '2');");
        //$win = $this->db->exec('SELECT * FROM `countries`');
//$this->db->select('COUNTRY_ID, COUNTRY_NAME');
//$this->db->order('COUNTRY_ID', true);
//$this->db->limit(2);
//$res = $this->db->get('countries'); 

        /*
          while ($row = $win->fetchAssoc()) {
          var_dump($row);
          }
         */
        $cookieData = array(
            'name' => 'pe6o',
            'value' => 'stamat',
            'expire' => time() + 10
        );
        //$this->input->setCookie($cookieData);
        //$this->input->unsetCookie('pe6o');
        //echo $this->input->cookie('pe6o');
        $this->load->library('session');
        $this->load->library('pagination');
        //echo $this->input->getUserAgent();
        //$this->session->setTempData('pe6o', 'go6o', 2);
        //echo $_SERVER['SERVER_NAME'];

        $this->load->library('validation');
        var_dump($this->validation->validate('log'));
        $this->view->show('let');
        echo validationErrors('log');
        //var_dump($this->load->isLoaded('validationa'));
        ?>
        <form action="" method="post">
            <input type="text" name="username">
            <input type="text" name="password">
            <input type="submit" value="gogo">
        </form>
        <?php
    }

}